const routerView = document.querySelector(".router-view");

export default function(data){
  return function(){
    let str = "";
    data.forEach(val=>{
      str += `<div class="box">
                <img src="${val.goodsImg}">
                <span>${val.goodsName}</span>
                <p>${val.price}</p>
                <input type="button" value="加入购物车">
              </div>`
    })
    routerView.innerHTML = str;
  }
}